<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_goods', function(Blueprint $table){
            $table->increments('id');
            $table->integer('tid')->comment('商品类别');
            $table->string('gname')->comment('商品名称');
            $table->string('price')->comment('价格');
            $table->string('cnt')->comment('库存');
            $table->string('scnt') ->default(0)->comment('销量');
            $table->string('vcnt')->nullable()->comment('浏览量');
            $table->string('gpic')->comment('图片名称');
            $table->string('gdesc')->comment('商品描述');
            $table->string('status')->comment('状态, 0为下架, 1为上架');
            $table->timeStamps();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
         Schema::drop('shop_goods');
    }
}
